<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWithdrawlogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('withdrawlogs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->nullable()->comment('提现发起人');
            $table->decimal('money',11,2)->nullable()->comment('提现金额');
            $table->decimal('remain_money',11,2)->nullable()->comment('账号应剩金额');
            $table->string('order_num',100)->nullable()->comment('提现订单号');
            $table->integer('payway')->default(0)->comment('0未发放 1通过微信发放给客户 2通过支付宝发放给客户');
            $table->string('info',100)->nullable()->comment('备注信息');
            $table->string('fail_reason')->nullable()->comment('提现失败理由');
            $table->integer('state')->default(0)->comment('0发起订单  1提现成功 -1提现失败');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('withdrawlogs');
    }
}
